package com.heima.comment.pojos.entity;

import com.heima.utils.thread.ThreadLocalUtil;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

/**
 * APP评论回复信息
 */
@Data
@Document("ap_comment_repay")
@NoArgsConstructor
public class ApCommentRepay {
    public ApCommentRepay(Long id){
        this.id = id;
        this.setAuthorId(ThreadLocalUtil.get());
        this.likes = 0;
        this.createdTime = new Date();
        this.updatedTime = new Date();
    }

    /**
     * id
     */
    @Id
    private Long id;

    /**
     * 用户ID
     */
    private Integer authorId;

    /**
     * 用户昵称
     */
    private String authorName;

    /**
     * 评论id
     */
    private Long commentId;

    /**
     * 回复内容
     */
    private String content;

    /**
     * 点赞数
     */
    private Integer likes;

    /**
     * 创建时间
     */
    private Date createdTime;

    /**
     * 更新时间
     */
    private Date updatedTime;

}